package com.appleyk.controller;

import com.appleyk.core.AuthUser;
import com.appleyk.service.AuthUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * <p>测试</p>
 *
 * @author Appleyk
 * @version v1.0
 * @blob https://blog.csdn.net/appleyk
 * @github https://github.com/kobeyk
 * @date created on 2023/9/23:21:55
 */
@CrossOrigin
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private AuthUserService userService;

    @PostMapping("register")
    public ResponseEntity register(@RequestBody AuthUser authUser){
        return ResponseEntity.ok(userService.register(authUser));
    }

    @GetMapping("query")
    public ResponseEntity query(){
        return ResponseEntity.ok(userService.query());
    }

}
